<template>
  <div>
    <div ref="echarts" style="width: 600px; height: 400px;"></div>
  </div>
</template>

<script>
import * as echarts from 'echarts'
export default {
  name: 'EChartsComponent',
  data () {
    return {
      myChart: undefined
    }
  },
  mounted () {
    this.showLine1()
  },
  methods: {
    showLine1 () {
      this.myChart = echarts.init(this.$refs.echarts)
      this.myChart.setOption({
        color: [
          '#dd44ee', '#fec42c', '#80F1BE'
        ],
        title: {
          text: '柱状图带颜色'
        },
        tooltip: {},
        xAxis: {
          data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
        },
        yAxis: {},
        visualMap: {
          orient: 'horizontal',
          left: 'center',
          min: 10,
          max: 100,
          text: ['High Score', 'Low Score'],
          // Map the score column to color
          inRange: {
            color: ['#65B581', '#FFCE34', '#FD665F']
          }
        },
        series: [
          {
            name: '储量',
            type: 'bar',
            data: [5, 20, 46, 70, 80, 90]
          }
        ]
      })
    }
  }
}
</script>
<style lang="scss" scoped></style>
